import { RouteRecordRaw} from 'vue-router'

export const PublicRoutes: Array<RouteRecordRaw> = [
    { 
        path: '/',
        name: 'manager',  // 页面管理器
        component: () => import('@/views/Manager.vue'),
        children: 
        [
            {
                path: '/',
                name: 'home', // 首页
                component: () => import('@/views/HomeView.vue')
            },
            {
                path: '/course',
                name: 'course', // 课程
                component: () => import('@/views/course/CourseViewManager.vue'),
                children: 
                [ 
                    {
                        path: '',
                        name: 'courseHome', // 课程列表
                        component: () => import('@/views/course/CourseHomeView.vue')
                    },
                    {
                      path: 'courseDetails/:courseId',
                      name: 'courseDetails', // 课程详情
                      component: () => import('@/views/course/CourseDetailsView.vue'),
                      children:
                      [
                          {
                              path: '',
                              name: 'courseIntroduction', // 课程介绍
                              component: () => import('@/views/course/courseDetails/CourseIntroductionView.vue')
                          },
                          {
                              path: 'courseChapterList',
                              name: 'courseChapterList', // 课程章节列表
                              component: () => import('@/views/course/courseDetails/CourseChapterListView.vue')
                          },
                          {
                              path: 'courseResources',
                              name: 'courseResources', // 课程习题
                              component: () => import('@/views/course/courseDetails/CourseResourcesView.vue')
                          },
                          {
                              path: 'courseEvaluate',
                              name: 'courseEvaluate', // 课程评价
                              component: () => import('@/views/course/courseDetails/CourseEvaluateView.vue')
                          }
                      ]
                    },
                    {
                        path: 'courseContent/:courseId',
                        name: 'courseContent', // 课程内容
                        component: () => import('@/views/course/courseDetails/courseContent/CourseContentView.vue'),
                        meta: { requiresAuth: false },
                        children: [
                            // {
                            //     path: '',
                            //     name: 'courseNotice', // 课程通知
                            //     component: () => import('@/views/course/courseDetails/courseContent/courseNoticeView.vue'),
                            //     meta: { navIndex: 1 },
                            // },
                            {
                                path: 'courseContentChapter',
                                name: 'courseContentChapter', // 章节列表
                                component: () => import('@/views/course/courseDetails/courseContent/CourseContentChapterView.vue'),
                                meta: { navIndex: 1 },
                            },
                            {
                                path: 'courseContentExercise',
                                name: 'courseContentExercise', // 作业列表
                                component: () => import('@/views/course/courseDetails/courseContent/CourseContentExerciseView.vue'),
                                meta: { navIndex: 2 },
                            },
                            {
                                path: 'courseContentResources',
                                name: 'courseContentResources', // 资源列表
                                component: () => import('@/views/course/courseDetails/courseContent/CourseContentResourcesView.vue'),
                                meta: { navIndex: 3 },
                            },
                            {
                                path: 'courseContentStudent',
                                name: 'courseContentStudent', // 学生列表
                                component: () => import('@/views/course/courseDetails/courseContent/CourseContentStudentView.vue'),
                                meta: { navIndex: 4 },
                            },
                            {
                                path: 'courseQuestionBank',
                                name: 'courseQuestionBank', // 课程题库
                                component: () => import('@/views/course/courseDetails/courseContent/CourseQuestionBankView.vue'),
                                meta: { navIndex: 5 },
                            }
                        ]
                    }
                ] 
            },  
            { 
                path: '/questionBank',
                name: 'questionBank', // 题库主页
                component: () => import('@/views/questionBank/QuestionBankViewManager.vue'),
                children: 
                [ 
                    {
                      path: '',
                      name: 'questionBankHome', // 题库主页
                      component: () => import('@/views/questionBank/QuestionBankHomeView.vue')
                    },
                    {
                    //   path: 'questionBankRandomQuiz/:multipleChoice/:gapFilling/:shortAnswer/:trueOrFalse/:difficulty/:knowledge',
                      path: 'questionBankRandomQuiz/:topicId',
                      name: 'questionBankRandomQuiz', // 试卷或练习组件
                      component: () => import('@/views/questionBank/QuestionBankRandomQuiz.vue'),
                      meta: { requiresAuth: true },
                      props: true,
                    },
                    {
                      path: 'questionBankDetails/:topicId',
                      name: 'questionBankDetails', // 做题详情
                      component: () => import('@/views/questionBank/QuestionBankDetails.vue'),
                      meta: { requiresAuth: true },
                      props: true,
                    },
                    {
                      path: 'questionBankManagement',
                      name: 'questionBankManagement', // 题库管理
                      component: () => import('@/views/questionBank/QuestionBankManagement.vue')
                    },
                    {
                        path: 'questionBankExplanation',
                        name: 'questionBankExplanation', // 组卷页面
                        component: () => import('@/views/questionBank/QuestionBankExplanation.vue'),
                        meta: { requiresAuth: true },
                    },
                    // {
                    //     path: 'questionBankExplanation',
                    //     name: 'questionBankExplanation', // 组卷页面
                    //     component: () => import('@/views/questionBank/groupExam/Index.vue'),
                    //     meta: { requiresAuth: true },
                    // },
                    {
                       path: 'LeetCodeHot',
                       name: 'LeetCodeHot', // LeetCodeHot会话组件
                       component: () => import('@/views/questionBank/LeetCodeHot.vue'),
                       meta: { requiresAuth: true },
                    },
                    {
                        path: 'groupVolumeIndex',
                        name: 'groupVolumeIndex', // 组卷效果组件
                        component: () => import('@/views/questionBank/GroupVolumeModule/GroupVolumeIndex.vue'),
                        meta: { requiresAuth: true },
                     }
                ]
            },
            {
                path: '/note',
                name: 'note',// 笔记
                component: () => import('@/views/note/NoteManager.vue'),
                children: [ 
                    {
                        path: '',
                        name: 'noteHome',
                        component: () => import('@/views/note/NoteView.vue'),
                        meta: { requiresAuth: false }
                    },
                    {
                        path: 'notewrite',
                        name: 'notewrite',//写笔记
                        component: () => import('@/views/note/WriteNote.vue'),
                        meta: { requiresAuth: false }
                    },
                    {
                        path: 'clouddisk',
                        name: 'clouddisk',//我的云盘
                        component: () => import('@/views/note/Clouddisk.vue'),
                        meta: { requiresAuth: false }
                    }
                ]
            },
            {
                path: '/ollama',
                name: 'ollama', // AI小云
                component: () => import('@/views/deepSeek/Ollama.vue')
            },
            {
                path: '/aiTeacher',
                name: 'aiTeacher', // AI小云
                component: () => import('@/views/aiTeacher/AiTeacherView.vue')
            },
            {
                path: '/message',
                name: 'message', // AI小云
                component: () => import('@/views/message/MessageView.vue')
            },
            {
                path: '/personalCenter',
                name: 'personalCenter', // 个人中心
                component: () => import('@/views/user/PersonalCenterView.vue'),
                children: 
                [
                    {
                        path: '',
                        name: 'personalCenterUserInformation', // 个人信息
                        component: () => import('@/views/user/personalCenter/UserInformationView.vue')
                    },
                    {
                        path: 'myCourse',
                        name: 'personalCenterMyCourse', // 我的课程
                        component: () => import('@/views/user/personalCenter/MyCourseView.vue')
                    },
                    {
                        path: 'myCollection',
                        name: 'personalCenterMyCollection', // 我的收藏
                        component: () => import('@/views/user/personalCenter/MyCollectionView.vue')
                    },
                    {
                        path: 'learningRecord',
                        name: 'personalCenterLearningRecord', // 学习记录
                        component: () => import('@/views/user/personalCenter/LearningRecordView.vue')
                    }
                ]
            }
        ]
    },
    {
        path: '/loginRegister',
        name: 'loginRegister', // 登录注册
        component:  () => import('@/views/user/LoginRegisterManage.vue'),
        children:
        [
            {
                path: '',
                name: 'login', // 登录
                component: () => import('@/views/user/loginRegister/LoginView.vue')
            },
            {
                path: 'register',
                name: 'register', // 注册
                component: () => import('@/views/user/loginRegister/RegisterView.vue')
            },
            {
                path: 'forgetPassword',
                name: 'forgetPassword', // 忘记密码
                component: () => import('@/views/user/loginRegister/ForgetPasswordView.vue')
            }
        ]
    },
    {
        path: '/member',
        name: 'member',
        component: () => import('@/views/member/MemberView.vue'),
        meta: {
            title: 'Plus 会员'
        }
    }
];
